#!/bin/sh

export PATH=/usr/bin:/bin

printf 'Content-type: text/html\r\n\r\n'

tac ../var/log/oaxaca.txt |
sed '/oaxaca-[^:]*: debug: /d' |
head -1000  | 
sed '
  s/&/\&amp;/g
  s/</\&lt;/g
  s/>/\&gt;/g
  s/"/\&quot;/g
  s/-\([0-9]\)/\&minus;\1/g
  s/\([0-9]\)\&minus;/\1-/g
  s/: error: /: <emph class="error">error<\/emph>: /
'
